﻿<!DOCTYPE html>
<html>
<head>
    <!--<base href="../" />-->
    <meta charset="UTF-8">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="/static/css/common/reset.css" />
    <link rel="stylesheet" href="/static/css/associate.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor-html.css" />
    <title>社团首页</title>
</head>
<body>
    <div class="contractDetail" ng-app="myApp">
        <div id="divHeader"></div>
        <div ng-controller="contractDetailsCtrl">
            <div ng-model="names">
                <section class="main pt10">
                    <ul class="support-ul pt10 clearfix">
                        <li>首页</li>
                        <li>社团</li>
                        <li>赞助筹备</li>
                        <li>社团筹备</li>
                        <li>详情查看</li>
                    </ul>
                </section>
                <section class="main">
                    <div class="support-activity">
                        <h1 class="f20 textcenter">{{names.ProjectName}}</h1>
                        <h2 class="textcenter mt10">{{names.CreateDate}}      <span class="colorRed">200</span>人已浏览</h2>
                    </div>
                </section>
                <section class="main">
                    <!--<h2 class="f16 mb10">合作状态:
                        <select>
                            <option>未确定</option>
                            <option>已同意</option>
                            <option>已拒绝</option>
                            <option>已过期</option>
                        </select>
                    </h2>-->
                    <ul class="support-list">
                        <li class="clearfix">
                            <div class="w100 fl">
                                <div class="w100 f16 clearfix">
                                    <p class="fl">赞助企业：{{names.Name}}</p>
                                    <p class="fr f14 colorLGray">{{names.ContractDate}}</p>
                                </div>
                                <p class="mt10 f14">
                                    <span>企业联系人：{{names.ContractorName}} </span>
                                    <span class="ml20">联系电话：{{names.ContractorPhone}}</span>
                                    <span class="ml20">QQ：{{names.ContractorQQ}}</span>
                                </p>
                                <div class="contract-progress">
                                    <div class="contract-progress-bar f20 clearfix">
                                        <p>确定合同</p>
                                        <p>企业付款</p>
                                        <p>社团首款</p>
                                        <p>活动反馈</p>
                                        <p>社团尾款</p>
                                    </div>
                                    <div class="contract-progress-bar proBanner">
                                        <h1 class="contract-pbar-bg"></h1>
                                        <!--done是打钩状态，doing是数字状态，bar是长度条-->
                                        <p class="done"><span>1</span><label class="hide">1</label></p>
                                        <p class=""><span>2</span><label class="hide">2</label></p>
                                        <p class=""><span>3</span><label class="hide">3</label></p>
                                        <p><span>4</span><label class="hide">4</label></p>
                                        <p><span>5</span><label class="hide">5</label></p>
                                    </div>
                                    <div class="contract-progress-bar f16 clearfix">
                                        <p>{{names.SignDate}}</p>
                                        <p></p>
                                        <p></p>
                                        <p></p>
                                        <p></p>
                                    </div>
                                    <div class="contract-progress-bar proTips f16 mt10 clearfix">
                                        <p class="{{names.Status == 'Effective' && names.SubStatus=='Pending' ? 'show' : '' }}">
                                            <a href="javascript:void(0)" class="contract-cancel">取消合同</a>
                                        </p>
                                        <p>请提交活动反馈</p>
                                        <p>请提交活动反馈</p>
                                        <p class="{{names.Status == 'Effective' && names.SubStatus=='Pending' ? 'show' : 'hide' }}">
                                            <a href="javascript:void(0)" class="contract-pBar-feedback">请提交活动反馈</a>
                                        </p>
                                        <p class="{{names.Status == 'Effective' && names.SubStatus=='FeedbackSubmitted' ? 'show' : 'hide' }}">已提交活动反馈</p>
                                        <p class="{{names.Status == 'Effective' && names.SubStatus=='FeedbackRejected' ? 'show' : 'hide' }}">
                                            企业不满意，<a href="javascript:void(0)" class="contract-pBar-feedback">请再次提交</a>或联系宾果客服。
                                        </p>
                                        <p>请提交活动反馈</p>
                                    </div>
                                </div>
                                <div class="contract-detailBtn clearfix">
                                    <a href="javascript:void(0);" tag="{{names.TemplateVersion}}" onclick="ViewContract(this)">合同详情</a>
                                </div>
                            </div>
                        </li>
                        <!--<li class="clearfix">
                            <div class="w100 fl">
                                <div class="w100 f16 clearfix">
                                    <p class="fl">赞助企业：可口可乐有限公司</p>
                                    <p class="fr f14 colorLGray">2016-10-01 23:55</p>
                                </div>
                                <p class="mt10 f14">
                                    <span>企业联系人：杨志斌 </span>
                                    <span class="ml20">联系电话：1111111111111</span>
                                    <span class="ml20">QQ：1111111111111</span>
                                </p>
                                <div class="contract-progress">
                                    <div class="contract-progress-bar f20 clearfix">
                                        <p>确定合同</p>
                                        <p>企业付款</p>
                                        <p>社团首款</p>
                                        <p>活动反馈</p>
                                        <p>社团尾款</p>
                                    </div>
                                    <div class="contract-progress-bar proBanner">
                                        <h1 class="contract-pbar-bg"></h1>
                                        <p class="done"><span>1</span><label class="hide">1</label></p>
                                        <p class=""><span>2</span><label class="hide">2</label></p>
                                        <p class=""><span>3</span><label class="hide">3</label></p>
                                        <p><span>4</span><label class="hide">4</label></p>
                                        <p><span>5</span><label class="hide">5</label></p>
                                    </div>
                                    <div class="contract-progress-bar f16 clearfix">
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                    </div>
                                    <div class="contract-progress-bar proTips f16 mt10 clearfix">
                                        <p>取消合同</p>
                                        <p>请提交活动反馈</p>
                                        <p>请提交活动反馈</p>
                                        <p class="show"><a href="javascript:void(0)" class="contract-pBar-feedback">请提交活动反馈</a></p>
                                        <p>请提交活动反馈</p>
                                    </div>
                                </div>
                                <div class="contract-detailBtn clearfix">
                                    <a href="javascript:void(0);">合同详情</a>
                                </div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="w100 fl">
                                <div class="w100 f16 clearfix">
                                    <p class="fl">赞助企业：可口可乐有限公司</p>
                                    <p class="fr f14 colorLGray">2016-10-01 23:55</p>
                                </div>
                                <p class="mt10 f14">
                                    <span>企业联系人：杨志斌 </span>
                                    <span class="ml20">联系电话：1111111111111</span>
                                    <span class="ml20">QQ：1111111111111</span>
                                </p>
                                <div class="contract-progress">
                                    <div class="contract-progress-bar f20 clearfix">
                                        <p>确定合同</p>
                                        <p>企业付款</p>
                                        <p>社团首款</p>
                                        <p>活动反馈</p>
                                        <p>社团尾款</p>
                                    </div>
                                    <div class="contract-progress-bar proBanner">
                                        <h1 class="contract-pbar-bg"></h1>
                                        <p class="done"><span>1</span><label class="hide">1</label></p>
                                        <p class="done bar"><span>2</span><label class="hide">2</label></p>
                                        <p class="doing bar"><span>3</span><label class="hide">3</label></p>
                                        <p><span>4</span><label class="hide">4</label></p>
                                        <p><span>5</span><label class="hide">5</label></p>
                                    </div>
                                    <div class="contract-progress-bar f16 clearfix">
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                    </div>
                                    <div class="contract-progress-bar proTips f16 mt10 clearfix">
                                        <p>取消合同</p>
                                        <p>请提交活动反馈</p>
                                        <p>请提交活动反馈</p>
                                        <p class="show">企业不满意，<a href="javascript:void(0)" class="contract-pBar-feedback">请再次提交</a>或联系宾果客服。</p>
                                        <p>请提交活动反馈</p>
                                    </div>
                                </div>
                                <div class="contract-detailBtn clearfix">
                                    <a href="javascript:void(0);">合同详情</a>
                                </div>
                            </div>
                        </li>
                        <li class="clearfix">
                            <div class="w100 fl">
                                <div class="w100 f16 clearfix">
                                    <p class="fl">赞助企业：可口可乐有限公司</p>
                                    <p class="fr f14 colorLGray">2016-10-01 23:55</p>
                                </div>
                                <p class="mt10 f14">
                                    <span>企业联系人：杨志斌 </span>
                                    <span class="ml20">联系电话：1111111111111</span>
                                    <span class="ml20">QQ：1111111111111</span>
                                </p>
                                <div class="contract-progress">
                                    <div class="contract-progress-bar f20 clearfix">
                                        <p>确定合同</p>
                                        <p>企业付款</p>
                                        <p>社团首款</p>
                                        <p>活动反馈</p>
                                        <p>社团尾款</p>
                                    </div>
                                    <div class="contract-progress-bar proBanner">
                                        <h1 class="contract-pbar-bg"></h1>
                                        <p class="done"><span>1</span><label class="hide">1</label></p>
                                        <p class="done bar"><span>2</span><label class="hide">2</label></p>
                                        <p class="doing bar"><span>3</span><label class="hide">3</label></p>
                                        <p><span>4</span><label class="hide">4</label></p>
                                        <p><span>5</span><label class="hide">5</label></p>
                                    </div>
                                    <div class="contract-progress-bar f16 clearfix">
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                        <p>2016-10-01 00:00:00</p>
                                    </div>
                                    <div class="contract-progress-bar proTips f16 mt10 clearfix">
                                        <p class="show">企业终止合同<a href="javascript:void(0)" class="disblock">合同终止说明</a></p>
                                        <p>请提交活动反馈</p>
                                        <p>请提交活动反馈</p>
                                        <p>企业不满意，<a href="javascript:void(0)" class="contract-pBar-feedback">请再次提交</a>或联系宾果客服。</p>
                                        <p>请提交活动反馈</p>
                                    </div>
                                </div>
                                <div class="contract-detailBtn clearfix">
                                    <a href="javascript:void(0);">合同详情</a>
                                </div>
                            </div>
                        </li>-->
                    </ul>
                </section>
            </div>
        </div>
        <div id="divFooter"></div>
    </div>
    <!--遮罩层-->
    <div class="mask hide"></div>
    <!--提交反馈意见-->
    <div class="popBox contractBox hide" id="contractBox">
        <h1 class="contractBox-title">活动反馈<a href="javascript:void(0)" class="contractBox-title-close"></a></h1>
        <div class="contractBox-content">
            <p class="contractBox-content-url">
                <label>照片存储网址：</label>
                <input type="text" id="PhotosUrl" placeholder="请存储于百度网盘，再分享链接至此" />
            </p>
            <p class="contractBox-content-url">
                <label>视频存储网址：</label>
                <input type="text" id="VideoUrl" placeholder="请存储于百度网盘，再分享链接至此" />
            </p>
            <p class="contractBox-content-url">
                <label>推文存储网址：</label>
                <input type="text" id="TweetsUrl" placeholder="请存储于百度网盘，再分享链接至此" />
            </p>
            <div class="title mb10">
                <h3>请填写活动总结</h3>
            </div>
            <textarea id="ActivitySummary" placeholder="请输入活动总结"></textarea>
            <a href="javascript:void(0)" onclick="SubmitFeedback()" class="up-hb-submit">确认提交</a>
        </div>
    </div>
    <!--合同详情-->
    <!--<div class="popBox contractBox hide" id="contractDetailBox">
        <h1 class="contractBox-title">合同详情<a href="javascript:void(0)" class="contractBox-title-close"></a></h1>
        <div class="contractBox-content">
            <div class="contractBox-content-top">
                <h1 class="contractBox-cTop-title clearfix">
                    <p class="fl f16">甲方：<span>百事可乐有限公司</span></p>
                    <p class="fr f16">乙方：<span>广州大学-学生会</span></p>
                </h1>
                <article class="contract-cTop-text">
                    <h1 class="textcenter f24">合作项目 社团迎新晚会</h1>
                    经甲乙双方友好协商，本着优势互补、资源共享，互惠双赢的原则，达成如下协议，甲乙双方应明确并严格遵守协议规定的职责。
                </article>
            </div>
            <div class="contractBox-content-top mt20">
                <h1 class="contractBox-cTop-title clearfix">
                    <p class="fl f16">合同内容</p>
                </h1>
                <article class="contract-cTop-text">
                    <p>一、合作期间，双方的权力和义务如下：</p>
                    <p>（一）甲方职责</p>
                    <p>1、甲方须提供赞助金额5000元给乙方。</p>
                    <p>乙方实际获得金额为：4500元=5000元-500元（赞助提成）</p>
                    <p>（二）乙方职责</p>
                    <p>1、乙方须达到甲方的活动效果要求：</p>
                    <p></p>
                    <p>2、乙方须达到社团活动中的效果保证：</p>
                    <p></p>
                    <p>（三）保密原则</p>
                    <p>乙方和甲方均有义务履行保密义务与，未经对方同意，不得向任何第三方披露或透露有关本合同内容项目下的任何信息。</p>
                    <p>（四）违约责任</p>
                    <p>1、甲方和乙方应正当行使权力，履行义务，保证本合同的顺利进行。</p>
                    <p>2、任何一方没有充分、及时履行义务的，应当承担违约责任；给其他方造成损失的，应赔偿其他方由此所遭受的直接和间接经济损失。</p>
                    <p>（五）合同期限与终止</p>
                    <p>1、本合同自双方签署盖章之日起生效。</p>
                    <p>2、任何一方可在另一方发生违约行为并在该违约方收到守约方关于违约行为已发生并存在的通知的15日内仍未能对违约行为作出更正之时，可以通过向另一方发出一份书面通知的方式立即终止本合同。</p>
                </article>
            </div>
            <a href="javascript:void(0)" class="up-hb-submit">关闭</a>
        </div>
    </div>-->
    <div id="contractDetails"></div>
    <!--取消合同-->
    <div class="popBox contractBox hide" id="contractBox-cancel">
        <h1 class="contractBox-title">取消合同<a href="javascript:void(0)" class="contractBox-title-close"></a></h1>
        <div class="contractBox-content">
            <div class="title mb10">
                <h3>请选择取消原因</h3>
            </div>
            <ul class="contractBox-cancel clearfix" id="ulCancelRemark">
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="时间太赶" id="choose1">
                        <label for="choose1"></label>
                    </p>
                    <span class="veraT f14 ml10">时间太赶</span>
                </li>
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="社团准备不足" id="choose2">
                        <label for="choose2"></label>
                    </p>
                    <span class="veraT f14 ml10">社团准备不足</span>
                </li>
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="场地未能申请成功" id="choose3">
                        <label for="choose3"></label>
                    </p>
                    <span class="veraT f14 ml10">场地未能申请成功</span>
                </li>
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="领导审批未通过" id="choose4">
                        <label for="choose4"></label>
                    </p>
                    <span class="veraT f14 ml10">领导审批未通过</span>
                </li>
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="商家付款不及时" id="choose5">
                        <label for="choose5"></label>
                    </p>
                    <span class="veraT f14 ml10">商家付款不及时</span>
                </li>
                <li>
                    <p class="c-c-l clearfix">
                        <input type="radio" name="cancel" value="其他" id="choose6">
                        <label for="choose6"></label>
                    </p>
                    <span class="veraT f14 ml10">其他</span>
                </li>
            </ul>
            <a href="javascript:void(0)" onclick="Cancel()" class="up-hb-submit">确认取消</a>
        </div>
    </div>
    <script type="text/javascript" src="/static/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/static/js/common.js"></script>
    <script type="text/javascript" src="/static/js/angular.min.js"></script>
    <script type="text/javascript" src="/static/js/sweetalert.min.js"></script>
    <!--文字编辑器 -->
    <script type="text/javascript" src="/static/js/simditor/scripts/module.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/hotkeys.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/uploader.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/simditor.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/beautify-html.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/simditor-html.js"></script>
    <script>

        var param = common.getUrlArgStr();
        if (!common.checkValue(param.id))
            window.location = "contract.html";

        $("#divHeader").load("/wuc/header.html");
        $("#divFooter").load("/wuc/footer.html");

        common.CreateController({ name: 'contractDetailsCtrl', url: '/api/project/GetContract?id=' + param.id, objType: 'dict' });

        function AfterCompleted(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            window.location = "contract.html";
        }

        function Cancel() {

            var values = {};
            values.ContractID = param.id;
            values.Status = "Cancelled";

            $("#ulCancelRemark [type='radio']").each(function () {

                if ($(this).attr("checked") || $(this).prop("checked"))
                    values.CancelRemark = $(this).val();
            });

            common.commonAjax({ type: 'Post', url: '/api/project/UpdateContractStatus', data: values, sMethod: AfterCompleted, alert: true });
        }

        function SubmitFeedback() {

            var values = common.GetCtrlValues({
                ContentID: "contractBox"
            })

            values.ContractID = param.id;
            values.ActivitySummary = editor.getValue();

            common.commonAjax({ type: 'Post', url: '/api/project/SubmitFeedback', data: values, sMethod: AfterCompleted, alert: true });
        }

        function ViewContract(obj) {
            var tmpl = $(obj).attr("tag");

            if (!common.checkValue(tmpl)) {
                common.alertMessage("此赞助未生成合同信息。");
                return;
            }

            $("#contractDetails").load("/wuc/contractTemplate/" + tmpl + ".html", function () {
                Init(param.id);
            });
        }

        var editor = common.CreateEditor('ActivitySummary');

        $(".contract-pBar-feedback").on('click', function () {
            $(".mask,#contractBox").show();
        });
        //$(".contract-detailBtn a").on('click', function () {


        //});
        $(".contract-cancel").on('click', function () {
            $(".mask,#contractBox-cancel").show();
        });
        $(".contractBox-title-close, .up-hb-submit").on('click', function () {
            $(".mask,#contractBox,#contractDetailBox,#contractBox-cancel").hide();
        });
    </script>
</body>
</html>
